package com.smbms2.controller;

import com.smbms2.entity.UserInfo;
import com.smbms2.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@ResponseBody
public class HomeController {
    @Autowired
    UserInfoService service;
    @RequestMapping("/index")
    public List<UserInfo> index(){
        List<UserInfo> userList = service.getUserList();
        return userList;
    }
}
